<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue测试.html</title>
    <!--导入js package-->
    <script type="text/javascript" src="../01-vue_js/vue.js"></script>
</head>
<body>
<div id="root">
    <form @submit.prevent="demo">
        <label for="account">账号: </label>
        <input type="text" v-model.trim="account" id="account">
        <br><br>
        <label for="password">密码: </label>
        <input type="text" v-model.trim="password" id="password">
        <br><br>
        年龄: <input type="number" v-model="age" id="age">
        <br><br>
        性别:
        男<input type="radio" name="sex" value="man" v-model="sex">
        女<input type="radio" name="sex" value="women" v-model="sex">
        <br><br>
        爱好：
        学习<input type="checkbox" v-model="hobby" value="study">
        游戏<input type="checkbox" v-model="hobby" value="game">
        睡觉<input type="checkbox" v-model="hobby" value="sleep">
        <br><br>
        所属校区
        <select v-model="city">
            <option value="beijing">北京</option>
            <option value="shanghai">上海</option>
            <option value="shengzheng">深圳</option>
            <option value="wuhan">武汉</option>
        </select>
        <br><br>
        其他信息：
        <textarea v-model.laz.lazy="other"></textarea>
        <br><br>
        <input type="checkbox" v-model="agree">阅读并接<a href="https://www.bilibili.com/">《用户协议》</a>
        <br><br>
        <button>提交</button>
    </form>
</div>
<script type="text/javascript">
    // 关闭开发环境的警告提示
    Vue.config.productionTip = false
    // 创建vue的对象
    new Vue({
        el: '#root',
        data: {
            account: '',
            password: '',
            age: '',
            sex: 'man',
            hobby: [],
            city: 'beijing',
            other: '',
            agree: '',
        },
        methods: {
            demo() {
                alert("123456")
            }
        }
    })
</script>
</body>
</html>